directives.directive('echartsBox', ['$templateCache','tools',function ($templateCache,tools) {
	return {
		restrict: 'E',
		scope: {
			myOption: '='
		},
		replace: true,
		templateUrl: 'public/views/tpl/common/echarts.html',
		link: function (scope, iElement, iAttrs) {
			var charts = echarts.init($(iElement).find('.chartBox')[0]);

			console.log(scope.myOption);
			
			charts.setOption(scope.myOption.option,true);
			
			// charts.resize({
			// 	'width': $(iElement).parent().width(),
			// 	'height': $(iElement).parent().height()
			// });

			// tools.$post(scope.myOptions.post).then(function(){

			// },function(resp){

			// },function(errResp){});
		}
	};
}]);